package zsh.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LogAspect {
    @Pointcut("@annotation(zsh.aop.Log)")
    public void pointCut() {}

    @After("@annotation(log)")
    public void after(JoinPoint joinPoint , Log log) {
        System.out.println("--------------记录日志---------------");
        System.out.println("运行的方法"+log.method());
        System.out.println("方法描述"+log.desc());
        System.out.println("使用类型"+log.logType());
    }
}
